var __extends =
    (this && this.__extends) ||
    (function () {
      var o = function (t, n) {
        return (o =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (o, t) {
              o.__proto__ = t;
            }) ||
          function (o, t) {
            for (var n in t)
              Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
          })(t, n);
      };
      return function (t, n) {
        function e() {
          this.constructor = t;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        o(t, n),
          (t.prototype =
            null === n
              ? Object.create(n)
              : ((e.prototype = n.prototype), new e()));
      };
    })(),
  CommanTwoItemDialog = (function (o) {
    function t() {
      var t = o.call(this) || this;
      return (
        WebSocketService.addListener({
          caller: t,
          code: 5308,
          method: t.onLoadDataFn,
        }),
        t.btn_pochan_sure.on(Laya.Event.CLICK, t, t.onDidPoChanAction),
        t
      );
    }
    return (
      __extends(t, o),
      (t.showCommonDialog = function (o) {
        return (
          null == this.commonDialog &&
            ((this.commonDialog = new t()), (this.commonDialog.zOrder = 1e3)),
          this.commonDialog.popup(),
          this.commonDialog.initUI(),
          this.commonDialog
        );
      }),
      (t.prototype.initUI = function () {
        (this.isSureClick = !1), this.setupPoChanView();
      }),
      (t.prototype.setupPoChanView = function () {
        WebSocketService.send({ c: 5308, d: { roleId: Global.roleId } });
      }),
      (t.prototype.onDidPoChanAction = function () {
        (this.isSureClick = !0),
          WebSocketService.send({ c: 5308, d: { roleId: Global.roleId } });
      }),
      (t.prototype.onLoadDataFn = function (o) {
        o.data
          ? (this.label_pochan_num.text = "今日净值：" + o.data + "金")
          : (this.label_pochan_num.text = "今日净值：0金"),
          (this.label_pochan_content.text =
            "一个自然日中净负值达到2.5W时，可申请破产一次（一次领取1250金）"),
          ToastView.toastView(o.msg),
          this.isSureClick && this.close();
      }),
      t
    );
  })(ui.dialog.CommanTwoItemDialogUI);
